package com.study.lxy.service.impl;

import com.study.lxy.service.TransferService;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class TransferServiceImpl implements TransferService,InitializingBean,DisposableBean{

    public void transferIn(String account, double amt) {
        System.out.println("transfer into account : " + account + ",amt is : " + amt);
    }

    public void transferOut(String account, double amt) {
        System.out.println("transfer from account : " + account + ",amt is : " + amt);
    }
    @PostConstruct
    public void safeScan(){
        System.out.println("正在进行安全扫描....");
    }
    @PreDestroy
    public void destroy1(){
        System.out.println("正在清除您的操作痕迹....");
    }

    public void afterPropertiesSet() throws Exception {
        System.out.println("InitializingBean 正在初始化操作..");
    }

    public void destroy() throws Exception {
        System.out.println("DisposableBean 正在执行资源销毁...");
    }
}
